Compiled from
http://users.evitech.fi/~jaanah/IntroC/DBeech/3gl_flow.htm
http://en.wikipedia.org/wiki/Flowchart
http://www.nos.org/htm/basic2.htm
http://www.howell1964.freeserve.co.uk/Acorn/Atom/atap/atap_03.htm
What is a flow chart?
A flowchart (also spelled flow-chart and flow chart) is a schematic representation of a process.
They are commonly used in business/economic presentations to help the audience visualize the content better, or to find flaws in the process.
Examples include instructions for a bicycle's assembly, an attorney outlining a
case's timeline, diagram of an automobile plant's work flow, the decisions to
be taken on a tax form, et cetera.
Generally the start point, end points, inputs, outputs, possible paths and the
decisions that lead to these possible paths are included.
Flow-charts can be created by hand, but lately specialized diagram drawing
software has emerged that can also be used for the purpose, such as Visio and
Dia.
A simple flowchart for what to do if a lamp doesn't work
Why use a flow chart?
The Language of flow charts
The major symbols are the DECISION (also known as
selection) and the SEQUENCE (or process) symbols.
The START and STOP symbols are called the terminals.
The SUBPROCESS symbol is a variation on the sequence
symbol. There are also connectors drawn between the symbols and you will see
these used in the examples below.
Guidelines
or
Sequential Structures
A series of processes that follow in order.
If …Then
The IF ... THEN construct is shown
here and is also known as the NULL ELSE, meaning that there is no ELSE part.
|
|
If …Then… Else
The IF ... THEN ... ELSE ... construct has a process at each
branch of the decision symbol. The only difference here is that each value of
the decision (TRUE/FALSE) has a process associated with it.
Repeat loop.
Note that the repeat loop has the process preceding the
decision. This means that a repeat loop will always execute the process part at
least once. This is an important point to remember because it may not be what you
want to do. The repeat loop is usually written so that it iterates until the
condition becomes true.
|
While
The while loop is basically the reverse of the repeat loop,
the decision comes first, followed by the process. The while loop is usually
written so that it iterates while the condition is true. The while loop should
be used when it is possible that the process or processes which are in the
scope of the decision (that is, in the loop) may not need to execute.
|
|
FOR
Examples
The following example is an attempt to provide an algorithm for putting on a shirt. Consider the possibility of attempting to tell a robot (which must have everything given to it) how to do this: